home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_13_06 / saks / armexmpl.h < prev    next >
C/C++ Source or Header  |  1995-04-06  |  531b  |  25 lines

  1. Listing 1 - The example from the ARM limiting the 
  2. context sensitivity of class member declarations.
  3.  
  4. typedef int c;
  5. enum { i = 1 };
  6.  
  7. class X
  8.     {
  9.     char v[i];
  10.     int f() { return sizeof(c); }
  11.     char c;             // error: typedef name 'c'
  12.                         // redefined after use
  13.     enum { i = 2; };    // error: constant 'i'
  14.                         // redefined after use
  15.     };
  16.  
  17. typedef char *T;
  18.  
  19. struct Y
  20.     {
  21.     T a;
  22.     typedef long T;     // error: T already defined
  23.     T b;
  24.     };
  25.